// worker.js
self.onmessage = function(e) {
  const { symbol, instrument } = e.data;
  const freq = calculateFrequency(symbol);
  const buffer = generateAudioBuffer(freq, instrument);
  self.postMessage(buffer, [buffer]);
};